#include <iostream>
#include <algorithm>

using namespace std;

double w;
char ch;
int cost;

int main()
{
	cin >> w >> ch;
	if(ch == 'y') cost += 5;
	if(w < 1) cout << cost + 20 << endl;
	else cout << cost + 20 + ceil(w - 1) << endl;
	return 0;
}

